package com.product.android.commonInterface.task;

import java.io.Serializable;

import org.json.JSONObject;

import com.common.android.utils.JSONUtils;

public class OapScore implements Serializable {
	
	private static final String TAG = "OapScore";
	
	private int code;
	private String msg;
	private int unitid;
	private int uid;
	private int totalexp;
	private int signstatus;   //1 已签到， 0未签到
//	private boolean noResign = false;
	private int updatetime;
	
	private int level;
	
	
	private int minscore;
	private int maxscore;
	
	private int lotterychance;
	private int totalmoney;
	
	public int getCode() {
		return code;
	}
	
//	public boolean getResignFlag(){
//		return noResign;
//	}
//	
//	public void setResignFlag(boolean noResign){
//		this.noResign = noResign;
//	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public int getUnitid() {
		return unitid;
	}

	public void setUnitid(int unitid) {
		this.unitid = unitid;
	}

	public int getUid() {
		return uid;
	}

	public void setUid(int uid) {
		this.uid = uid;
	}

	public int getSignstatus() {
		return signstatus;
	}

	public void setSignstatus(int signstatus) {
		this.signstatus = signstatus;
	}
	
	public int getTotalexp() {
		return totalexp;
	}

	public void setTotalexp(int totalexp) {
		this.totalexp = totalexp;
	}

	public int getUpdatetime() {
		return updatetime;
	}

	public void setUpdatetime(int updatetime) {
		this.updatetime = updatetime;
	}

	public static String getTag() {
		return TAG;
	}
	
	public int getLevel() {
		return level;
	}

	public void setLevel(int level) {
		this.level = level;
	}

	public int getMinscore() {
		return minscore;
	}

	public void setMinscore(int minscore) {
		this.minscore = minscore;
	}

	public int getMaxscore() {
		return maxscore;
	}

	public void setMaxscore(int maxscore) {
		this.maxscore = maxscore;
	}

	public int getLotterychance() {
		return lotterychance;
	}

	public void setLotterychance(int lotterychance) {
		this.lotterychance = lotterychance;
	}
	
	public int getTotalmoney() {
		return totalmoney;
	}

	public void setTotalmoney(int totalmoney) {
		this.totalmoney = totalmoney;
	}
	
	public OapScore(){	}
	
	public void setScoreData(JSONObject json){
		this.code = JSONUtils.getInt(json, "code");
		this.msg = JSONUtils.getString(json, "msg");
		
		JSONObject score = null;
		score = JSONUtils.getJSONObject(json, "score");		

		this.uid = JSONUtils.getInt(score, "uid");
		this.totalexp = JSONUtils.getInt(score, "totalexp");
		this.lotterychance = JSONUtils.getInt(score, "lotterychance");
		this.totalmoney = JSONUtils.getInt(score, "totalmoney");	
		this.updatetime = JSONUtils.getInt(score, "updatetime");			
		this.signstatus = JSONUtils.getInt(score, "signstatus");		
		JSONObject content = JSONUtils.getJSONObject(score, "levelinfo");			
		this.level = JSONUtils.getInt(content, "level");
		this.minscore = JSONUtils.getInt(content, "minscore");
		this.maxscore = JSONUtils.getInt(content, "maxscore");
	}	
	
	public void clearScoreData(){
		this.code = 0;
		this.msg = "";
		this.uid = 0;
		this.totalexp = 0;
		this.lotterychance = 0;
		this.totalmoney = 0;	
		this.updatetime = 0;			
		this.signstatus = 0;		
		
		this.level = 0;
		this.minscore = 0;
		this.maxscore = 0;
	}
}
